#ifndef __ADC_H__
#define __ADC_H__

#define ADC_DADP0 0
#define ADC_DADP1 1
#define ADC_DADP2 2
#define ADC_DADP3 3
#define ADC_AD4 4
#define ADC_AD5 5
#define ADC_AD6 6
#define ADC_AD7 7
#define ADC_AD8 8
#define ADC_AD9 9
#define ADC_AD10 10
#define ADC_AD11 11
#define ADC_AD12 12
#define ADC_AD13 13
#define ADC_AD14 14
#define ADC_AD15 15
#define ADC_AD16 16
#define ADC_AD17 17
#define ADC_AD18 18
#define ADC_AD19 19
#define ADC_AD20 20
#define ADC_AD21 21
#define ADC_AD22 22
#define ADC_AD23 23

#define ADC_8bit 0x00
#define ADC_12bit 0x01
#define ADC_10bit 0x02
#define ADC_16bit 0x03

#define NORMAL_SPEED 0
#define HIGH_SPEED 1

#define ADCK_24 0x00
#define ADCK_16 0x01
#define ADCK_10 0x02
#define ADCK_6 0x03
#define ADCK_NO 0x04

#define ADC_A 0x00
#define ADC_B 0x01

#define AVGS_4 0x00
#define AVGS_8 0x01
#define AVGS_16 0x02
#define AVGS_32 0x03
#define AVGS_NO 0x04

#define ADC_DMA_DIS 0
#define ADC_DMA_EN 1

int adc_init(int bit, int speed, int st, int hwavg, int dma_en);
int adc_cal(void);
uint16 adc_read(int ch);

#endif /* __ADC_H__ */
